﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Default2 : AdminBasePage
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (LoginedStaff.tblRole.Role != "Admin")
            Response.Redirect("~/Admin/Index.aspx");
    }
    protected void Submit_Click(object sender, EventArgs e)
    {
        DALStaff staff = new DALStaff();
        Hash Cipher = new Hash();
        string HPass = Cipher.hash(tbpass.Text);
        tblStaff tabstaff = new tblStaff()
        {
            Username = tblogin.Text,
            Password = HPass,
            RoleID = Convert.ToInt16(ddlRole.SelectedValue),
            BranchID = Convert.ToInt16(ddlBrach.SelectedValue),
        };

        staff.InsertStaff(tabstaff);
        Response.Redirect("~/Admin/Staff/ListStaff.aspx");

    }
}